﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Infrastructure.ExternalService.Core.Responses
{
    public class ClassResponse
    {
        private string _startDate;
        private string _endDate;
        /// <summary>
        /// 考务费
        /// </summary>
        public long? examFee { get; set; }

        public string startDate
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_startDate))
                {
                    _startDate = DateTime.MinValue.ToString();
                    return _startDate;
                }
                return _startDate;
            }
            set { _startDate = value; }
        }

        public string endDate
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_endDate))
                {
                    _endDate = DateTime.MinValue.ToString();
                    return _endDate;
                }
                return _endDate;
            }
            set { _endDate = value; }
        }


        public string schoolId { get; set; }
        /// <summary>
        /// 班型标识
        /// </summary>
        public string ClasstypeId { get; set; }
        /// <summary>
        /// 老班型
        /// </summary>
        public string OldClasstypeId { get; set; }
        /// <summary>
        /// 班型名称
        /// </summary>
        public string ClasstypeName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ClassId { get; set; }
        public char? ClasstypeDataStatus { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ClassName { get; set; }
        /// <summary>
        /// 班级最低折扣
        /// </summary>
        public decimal? ClassDiscount { get; set; }
        /// <summary>
        /// 班级推荐折扣
        /// </summary>
        public decimal? ClassAdviseDiscount { get; set; }
        /// <summary>
        /// 班型原价
        /// </summary>
        public long? ClassStdPrice { get; set; }
        /// <summary>
        /// 促销价
        /// </summary>
        public long? ClassPrice { get; set; }
        /// <summary>
        /// 班级促销状态
        /// </summary>
        public string ClassPromotionStatus { get; set; }
        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }
        /// <summary>
        /// 班级类别：M-全科、S-单科
        /// </summary>
        public string ClassCategory { get; set; }
        /// <summary>
        /// 项目年份周期标识
        /// </summary>
        public string PypId { get; set; }
        /// <summary>
        /// 班型年份
        /// </summary>
        public int? ClassYear { get; set; }
        /// <summary>
        /// 周期序号
        /// </summary>
        [JsonProperty("pypSeq")]
        public int? ClassPeriodSeq { get; set; }
        /// <summary>
        /// 授课方式
        /// </summary>
        public string ClassTeachMethod { get; set; }
        /// <summary>
        /// 服务结束时间
        /// </summary>
        public DateTime? ClassExpireDate { get; set; }
        /// <summary>
        /// 班级合计资料费
        /// </summary>
        public long? ClassBookAmount { get; set; }
        /// <summary>
        /// 班级是否包含资料
        /// </summary>
        public char? ClassGoodsStatus { get; set; }
        /// <summary>
        /// 是否邮寄资料(Y:是;N:否;)
        /// </summary>
        public char? ClassSendStatus { get; set; }
        /// <summary>
        /// 科目Id
        /// </summary>
        public string SubjectId { get; set; }
        /// <summary>
        /// 科目名称
        /// </summary>
        public string SubjectName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public char? SubjectNature { get; set; }
        /// <summary>
        /// 如果是全科班：此为全科包含的子科目
        /// </summary>
        public List<SubjectRes> Subjects { get; set; }

        /// <summary>
        /// 科目价格信息
        /// </summary>
        [JsonProperty("subjectClass")]
        public List<SubjectPriceRes> SubjectPrices { get; set; }

        #region 班级服务承诺相关信息
        [JsonProperty("classAtype")]
        public string AgreementType { get; set; }
        /// <summary>
        /// 服务类型:重读、退费、不退费不重读
        /// </summary>
        [JsonProperty("classAsertype")]
        public string ServiceType { get; set; }
        /// <summary>
        /// 协议重读次数
        /// </summary>
        [JsonProperty("classArepeatcount")]
        public int? RepeatCount { get; set; }
        /// <summary>
        /// 班级协议重读资料费各科累加(分)
        /// </summary>
        [JsonProperty("classArepeatbookamount")]
        public long? RepeatBookAmount { get; set; }

        /// <summary>
        /// 班级重读年份老数据字段(6:重读下一期;5:终身重读;XXXX:具体年份)
        /// </summary>
        [JsonProperty("classRepeatyear")]
        public int? ClassRepeatYear { get; private set; }
        /// <summary>
        /// 班级重读资料费老数据字段(单位:分)
        /// </summary>
        [JsonProperty("classRepeatbookamount")]
        public long? ClassRepeatBookAmount { get; private set; }

        /// <summary>
        /// 退费形式:全额退费;扣除资料费退费;每科按固定金额退费;每科按固定比例退费
        /// </summary>
        [JsonProperty("classArefundtype")]
        public string RefundType { get; set; }
        /// <summary>
        /// 退费量值：百分比或金额
        /// </summary>
        [JsonProperty("classARefundamount")]
        public long? RefundAmount { get; set; }
        [JsonProperty("atplId")]
        public string AtplId { get; set; }
        [JsonProperty("classAserclause")]
        public string ClassAserClause { get; set; }
        [JsonProperty("classAserschemo")]
        public string ClassAserSchemo { get; set; }
        [JsonProperty("classArefundsubjecttype")]
        public string ClassSubjectRefundType { get; set; }
        #endregion

        /// <summary>
        /// 
        /// </summary>
        public List<GoodsRes> Goods { get; set; }

        /// <summary>
        /// 班级营销状态
        /// </summary>
        public string ClassGiveStatus { get; set; }

        /// <summary>
        /// 班级学习卡状态
        /// </summary>
        public string ClassLearnCardStatus { get; set; }

        /// <summary>
        /// 班级内部学习状态
        /// </summary>
        public string ClassInnerLearnStatus { get; set; }

        /// <summary>
        /// 班级引流状态
        /// </summary>
        public string ClassDrainageStatus { get; set; }

        /// <summary>
        /// 班级捆绑状态
        /// </summary>
        public string ClassTypeBindstatus { get; set; }

        /// <summary>
        /// 班级企业定制状态
        /// </summary>
        public string ClassEnterpriseStatus { get; set; }

        /// <summary>
        /// 班级可用状态(Y:是;N:否;)
        /// </summary>
        public string ClassAvlStatus { get; set; }

        /// <summary>
        /// 班级过期状态(Y:是;N:否;)
        /// </summary>
        public string ClassExpireStatus { get; set; }

        /// <summary>
        /// 班级审核状态(Y:是;N:否;)
        /// </summary>
        public string ClassCheckStatus { get; set; }

        /// <summary>
        /// 班级上架状态(Y:是;N:否;)
        /// </summary>
        [JsonProperty("classOnsalestatus")]
        public string ClassOnSaleStatus { get; set; }

        /// <summary>
        /// 班级服务期次数
        /// </summary>
        [JsonProperty("classSeqtype")]
        public int? ClassServiceCount { get; set; }

        /// <summary>
        /// 产品过渡状态(Y:是;N:否; null)
        /// </summary>
        [JsonProperty("classtypeTransitionstatus")]
        public string ClasstypeTransitionStatus { get; set; }

        /// <summary>
        /// 赠课类型
        /// </summary>
        [JsonProperty("classtypeGivetype")]
        public string ClasstypeGivetype { get; set; }

        /// <summary>
        /// 赠课数量
        /// </summary>
        [JsonProperty("classtypeGivenum")]
        public string ClasstypeGivenum { get; set; }

        /// <summary>
        /// 班级固定过期年份
        /// </summary>
        [JsonProperty("yearNum")]
        public int? ClassExpireYear { get; set; }

        /// <summary>
        /// 班级固定过期月份
        /// </summary>
        [JsonProperty("monthNum")]
        public int? ClassExpireMonth { get; set; }

        /// <summary>
        /// 商品主体
        /// </summary>
        public string CompanyCode { get; set; }
    }

    public class SubjectRes
    {
        /// <summary>
        /// 科目Id
        /// </summary>
        public string SubjectId { get; set; }
        /// <summary>
        /// 科目名称
        /// </summary>
        public string SubjectName { get; set; }
        /// <summary>
        /// 班型科目协议退费比例
        /// </summary>
        public decimal? ClassSubjectARefundScale { get; set; }
    }

    public class GoodsRes
    {
        public string GoodsName { get; set; }
        public string GoodsId { get; set; }

        /// <summary>
        /// 资料科目标识
        /// </summary>
        [JsonProperty("subjectId")]
        public string SubjectId { get; set; }

        /// <summary>
        /// 单科资料费
        /// </summary>
        [JsonProperty("goodsFlatprice")]
        public long GoodsFlatPrice { get; set; }
    }

    public class SubjectPriceRes
    {
        [JsonProperty("classId")]
        public string SingleSubjectClassId { get; set; }
        [JsonProperty("subjectId")]
        public string SubjectId { get; set; }
        [JsonProperty("classStdprice")]
        public long? StandardPrice { get; set; }
        [JsonProperty("classPrice")]
        public long? PromotionPrice { get; set; }
    }


    public class CourseInfo
    {
        public long? classStdprice;
        public string projectId { get; set; }
        public string classId { get; set; }







    }
}
